Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bumping to latest ibc-go #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spoo-bar
Copy link
Contributor

@spoo-bar spoo-bar commented Oct 17, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced dependency management with updated and new libraries for improved functionality.
  • Bug Fixes

    • Resolved issues related to outdated dependencies that could affect performance and stability.
  • Documentation

    • Updated import paths to reflect changes in the library structure for better clarity and usage.

@spoo-bar spoo-bar marked this pull request as ready for review October 17, 2024 14:23
@spoo-bar spoo-bar requested a review from a team as a code owner October 17, 2024 14:23
Copy link

coderabbitai bot commented Oct 17, 2024

Walkthrough

The changes in this pull request involve significant updates to the go.mod file, including dependency version upgrades, the addition of new dependencies, and the removal of some existing ones. Notably, the ibc-go library has been upgraded from version 4 to version 8, resulting in changes to import paths in the middleware.go file. Additionally, the method implementations have been modified to use a new function for creating integers from big integers, while maintaining existing logic for fee transfers and deposits.

Changes

File(s) Change Summary
go.mod - Updated multiple dependencies to newer versions.
- Added new indirect dependencies.
- Removed certain dependencies.
- Modified replace directives.
middleware.go - Updated import paths for ibc-go modules from version 4 to version 8.
- Replaced sdk.NewIntFromBigInt with math.NewIntFromBigInt in method implementations.

Poem

🐇 In the meadow, changes bloom,
Dependencies shift, make room!
From v4 to v8 we leap,
New paths to explore, promises to keep.
With every update, we grow and play,
Hopping forward, come what may! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
go.mod (1)

12-12: Upgrade mvdan.cc/gofumpt to v0.6.0 – Check formatting compliance.

The gofumpt tool has been updated to v0.6.0. Since gofumpt enforces stricter formatting rules than gofmt, ensure the codebase is formatted using the updated version to prevent CI failures due to formatting issues.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 1a1aa2d and 8e6b214.

⛔ Files ignored due to path filters (2)
  • go.sum is excluded by !**/*.sum
  • go.work.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • go.mod (8 hunks)
  • middleware.go (5 hunks)
🧰 Additional context used
🔇 Additional comments (22)
middleware.go (6)

115-115: LGTM! Correct update for ibc-go v8.

The change from sdk.NewIntFromBigInt to math.NewIntFromBigInt is consistent with the upgrade to ibc-go v8. The functionality remains the same.


127-127: LGTM! Consistent update for ibc-go v8.

This change is identical to the previous one, correctly updating sdk.NewIntFromBigInt to math.NewIntFromBigInt for ibc-go v8 compatibility.


171-171: LGTM! Consistent update for ibc-go v8.

This change is consistent with the previous updates, correctly replacing sdk.NewIntFromBigInt with math.NewIntFromBigInt for ibc-go v8 compatibility.


Line range hint 1-215: Summary: Successful upgrade to ibc-go v8

This PR successfully updates the middleware.go file for compatibility with ibc-go v8. The changes include:

  1. Updated import paths for ibc-go packages.
  2. Moved capabilitytypes import from cosmos-sdk to ibc-go.
  3. Replaced sdk.NewIntFromBigInt with math.NewIntFromBigInt in multiple locations.

These changes are consistent and minimal, focusing solely on the version upgrade without introducing new functionality or logical changes. The PR objectives have been met.


183-183: LGTM! Verify all NewIntFromBigInt usages.

This change is consistent with the previous updates. To ensure completeness:

Please run this script to verify all NewIntFromBigInt usages have been updated:

#!/bin/bash
# Description: Check for any remaining usages of sdk.NewIntFromBigInt

# Test: Search for old sdk.NewIntFromBigInt usage. Expect: No results.
rg --type go 'sdk\.NewIntFromBigInt'

# Test: Search for new math.NewIntFromBigInt usage. Expect: Results only from updated files.
rg --type go 'math\.NewIntFromBigInt'

13-17: LGTM! Verify capabilitytypes usage.

The import path updates are correct for the upgrade to ibc-go v8. The move of capabilitytypes from cosmos-sdk to ibc-go is notable.

Please run this script to verify that all usages of capabilitytypes have been updated:

✅ Verification successful

Please run the following script to ensure that all imports of capabilitytypes have been updated correctly:


Verified capabilitytypes import paths.

All capabilitytypes imports have been successfully updated to "github.com/cosmos/ibc-go/modules/capability/types" in middleware.go.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining imports of capabilitytypes from cosmos-sdk

# Test: Search for old capabilitytypes import. Expect: No results.
rg --type go 'capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"'

# Test: Search for new capabilitytypes import. Expect: Results only from updated files.
rg --type go 'capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"'

Length of output: 700


Script:

#!/bin/bash
# Description: Verify that all imports of capabilitytypes have been updated to the new path.

# Test: Search for old capabilitytypes import. Expect: No results.
rg --type go 'capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"'

# Test: Search for new capabilitytypes import. Expect: At least one result.
rg --type go 'capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"'

Length of output: 250

go.mod (16)

6-6: Upgrade to cosmossdk.io/math v1.3.0 – Verify compatibility with codebase.

The dependency cosmossdk.io/math has been upgraded to v1.3.0. Ensure that any functions or types used from this package are compatible with the new version, and update any code that relies on deprecated or changed APIs.


7-7: Upgrade to github.com/circlefin/noble-cctp – Confirm compatibility with the new version.

The noble-cctp dependency has been updated to a newer commit. Verify that any interfaces or APIs used from this library are compatible with the new version, and adjust the code accordingly.


75-75: Upgrade to github.com/cosmos/cosmos-db v1.0.2 – Verify database interactions.

The cosmos-db dependency has been updated. Ensure that any database interactions in the code are compatible with the new version, and adjust for any API changes or improvements.


122-124: Confirm compatibility with updated protobuf dependencies.

  • github.com/gogo/googleapis updated to v1.4.1.
  • github.com/gogo/protobuf updated to v1.3.3.
  • github.com/golang/protobuf updated to v1.5.4.

Ensure that all protobuf-related code is compatible with these updated versions to prevent serialization/deserialization issues.


137-137: Update to github.com/google/go-cmp v0.6.0 – Verify test comparisons.

The go-cmp library is commonly used in tests for comparing complex data structures. Verify that tests using go-cmp are compatible with the updated version.


140-142: Verify compatibility with updated Gorilla packages.

  • github.com/gorilla/handlers updated.
  • github.com/gorilla/mux updated to v1.8.1.
  • github.com/gorilla/websocket updated.

Ensure that any HTTP routing, handling, or WebSocket functionality using these packages remains compatible.


147-147: Update to github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 – Check gRPC middlewares.

If your application uses gRPC middleware, verify that all middleware implementations are compatible with the updated library version.


217-220: Upgrade Prometheus client libraries – Verify metrics collection.

Prometheus client libraries have been updated:

  • github.com/prometheus/client_golang to v1.20.1.
  • github.com/prometheus/client_model to v0.6.1.
  • github.com/prometheus/common to v0.55.0.
  • github.com/prometheus/procfs to v0.15.1.

Ensure that metrics collection and exposition are functioning correctly with the updated versions.


229-229: Update to github.com/rs/zerolog v1.33.0 – Confirm logging functionalities.

If zerolog is used for logging, verify that logging configurations and outputs remain consistent with the new version.


247-251: Upgrade to spf13 libraries – Check command-line and configuration parsing.

  • github.com/spf13/afero to v1.11.0.
  • github.com/spf13/cast to v1.6.0.
  • github.com/spf13/cobra to v1.8.1.
  • github.com/spf13/viper to v1.19.0.

Ensure that any command-line interfaces and configuration parsing remain compatible with these updated libraries.


255-255: Update to github.com/stretchr/testify v1.9.0 – Verify test suites.

The testify library is commonly used for writing tests in Go. Ensure that your test suites are compatible with the updated version, particularly if you use any advanced features of testify.


283-291: Upgrade Go modules – Confirm compatibility with golang.org/x packages.

Several golang.org/x packages have been updated:

  • golang.org/x/crypto to v0.26.0.
  • golang.org/x/mod to v0.18.0.
  • golang.org/x/net to v0.28.0.
  • golang.org/x/sync to v0.8.0.
  • golang.org/x/sys to v0.24.0.
  • golang.org/x/term to v0.23.0.
  • golang.org/x/text to v0.17.0.

Ensure that your code remains compatible with these updates, especially if you're using any cryptographic functions, networking, synchronization primitives, or text processing.


296-297: Upgrade to google.golang.org/grpc v1.65.0 – Validate gRPC services.

The gRPC library has been updated. Verify that all gRPC services, clients, and interceptors are compatible with the new version, and address any deprecated or changed APIs.


8-8: ⚠️ Potential issue

Major upgrade to github.com/cosmos/cosmos-sdk v0.50.10 – Address potential breaking changes.

The cosmos-sdk has been upgraded from v0.45.16 to v0.50.10. This significant version change may introduce breaking changes or deprecations. It's important to:

  • Review the Cosmos SDK release notes and migration guides.
  • Identify and update any deprecated or changed APIs.
  • Run comprehensive tests to ensure the application functions correctly with the new SDK version.

308-308: 🛠️ Refactor suggestion

Review replace directives – Confirm necessity after dependency upgrades.

After upgrading dependencies, particularly github.com/gogo/protobuf, ensure that the existing replace directives are still required. Specifically:

  • github.com/gogo/protobuf Replacement: Verify if pointing to github.com/regen-network/protobuf v1.3.3-alpha.regen.1 is still necessary or if upstream dependencies have been updated to address previous issues.
  • github.com/ChainSafe/go-schnorrkel Replacement: Confirm that replacing this dependency is still appropriate.

Adjust or remove replace directives if they are no longer needed to prevent potential conflicts.


10-10: ⚠️ Potential issue

Upgrade to github.com/cosmos/ibc-go/v8 v8.5.1 – Update import paths and code accordingly.

The ibc-go module has been upgraded from v4.6.0 to v8.5.1. This major version change includes significant updates that may impact the codebase, such as:

  • Import Path Changes: Ensure all import paths are updated to github.com/cosmos/ibc-go/v8.
  • API Changes: Review and update code to accommodate any changes in the IBC module APIs.
  • Protocol Updates: Verify compatibility with any protocol-level changes introduced in IBC-Go v8.

To verify that all import paths have been updated, run the following script:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant